import sqlite3

# 删除
con = sqlite3.connect("db1.db")
sql = 'delete from t_person where pno=?'
cursor = con.cursor()

try:
    cursor.execute(sql,(1,))
    con.commit()
    print("删除成功")
except Exception as e:
    print(e)
    print("删除数据失败")
finally:
    cursor.close()
    con.close()